<html>
  <head>
    <link href="../enzo.css" rel="stylesheet" type="text/css">
    <title>Enzo user's guide: setting up a cosmology simulation</title>
  </head>
<body>
<h1>Preparing a cosmology simulation</h1>
This section describes how to create the parameter file for a cosmology
simulation with Enzo, once you have generated the initial data
(with inits, described earlier).&nbsp;&nbsp; There is a sample <a href="EnzoSingleParameterFile">single-grid</a>
parameter file in <tt>amr_mpi/exe</tt> called <tt>AMRCosmologySimulation</tt>.&nbsp;
It is probably easiest to modify this to suit your needs; a 
<a href="http://cosmos.ucsd.edu/enzo-devel/parameters/index-enzo.html">list</a>
of all parameters is provided elsewhere.
<p>Each line of the parameter file is interpreted independently and can
contain only a single parameter. Parameters are specified in the form:
<p><tt>ParameterName = VALUE</tt>
<p>Spaces are ignored, and the parameter statement must be contained on
a single line. Lines which begin with the pound symbol (#) are assumed
to be comments and ignored.&nbsp; If a parameter is a toggle switch (i.e.
on/off), then 0 means off and 1 is on.
<p>For single grid set-ups (by single grid, we mean a single initial grid
-- if adaptive meshing is turned on, more grids will be generated as the
simulation runs), there are many possible parameters to set.&nbsp; However,
most of the important one are listed in the example parameter file mentioned
earlier.&nbsp; A few examples follow.&nbsp; The adaptive meshing is turned
off by setting StaticHierarchy = 1, while the most refined level that the
code will allow is set by MaximumRefinementLevel.&nbsp; The refinement
factor from one level to the next (i.e. the ratio of mesh spacing) is set
by the parameter RefinementFactor, which must be an integer (usually 2
is a good choice).
<p>A multiple initial grid setup (see also the inits section) has a parameter
file which is very similar, except that you must specify the number of
initial grids with the parameter CosmologySimulationNumberOfInitialGrids.&nbsp;
The first (root) grid is assumed to cover the entire computational domain
(and has dimensions given by TopGridDimensions); however, additional grids
must have their size and location specified by a series of four parameters
(for each grid): CosmologySimulationGridDimension[#], CosmologySimulationGridLeftEdge[#],
CosmologySimulationGridRightEdge[#], and CosmologySimulationGridLevel[#],
where # is the number of the additional grids, starting with 1.&nbsp; Note
that when setting the MinimumOverDensityForRefinement parameter for a multi-grid
simulation, the value of this parameter refers to the top grid.&nbsp; Normally,
if you are using sub-grids, you will want to decrease this value by RefineBy^(Rank*max_level),
where max_level is the maximum level of the initial grid hierarchy.&nbsp;
Thus, if RefineBy=2, Rank=3 and you are using a three grid initial set
up, decrease the desired over density (usually 4-8) by 64 (I recognize
this makes little sense, but there it is).&nbsp; An
<a href="EnzoMultipleParameterFile">example</a>
of a three grid initial set-up is available.
<p>See the <a href="../cookbook/index.html">Enzo Cookbook</a> for a more complete primer on the important parametres.</p>


<p>&nbsp;</p>
<p><a href="../index.html">Go to the Enzo home page</a></p>


<hr WIDTH="100%">
<center>&copy; 2004 &nbsp; <a href="http://cosmos.ucsd.edu">Laboratory for Computational Astrophysics</a><br></center>
<center>last modified February 2004<br>
by <a href="mailto:bwoshea (AT) lanl.gov">B.W. O'Shea</a></center>
</body>
</html>
